package com.ruyuan.eshop.construction.converter;

import com.ruyuan.eshop.construction.domain.dto.FrontCategoryDTO;
import com.ruyuan.eshop.construction.domain.dto.FrontCategoryTreeDTO;
import com.ruyuan.eshop.construction.domain.entity.FrontCategoryDO;
import com.ruyuan.eshop.construction.domain.entity.FrontCategoryTreeDO;
import com.ruyuan.eshop.construction.domain.request.CategoryRequest;
import com.ruyuan.eshop.construction.domain.request.FrontCategoryRequest;
import com.ruyuan.eshop.construction.domain.request.QueryCategoryRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * 前台类目相关对象克隆
 * @author zhonghuashishan
 * @version 1.0
 */
@Mapper(componentModel = "spring")
public interface FrontCategoryConverter {
    /**
     *  集合对象克隆
     * @param list
     * @return
     */
    List<FrontCategoryTreeDTO> converterTreeList(List<FrontCategoryTreeDO> list);

    /**
     * 对象克隆
     * @param categoryQueryRequest
     * @return
     */
    FrontCategoryDO converterDO(QueryCategoryRequest categoryQueryRequest);

    /**
     * 对象克隆
     * @param frontCategoryRequest
     * @return
     */
    @Mappings({
            @Mapping(target = "updateUser", source = "operateUser")
    })
    FrontCategoryDO converterDO(FrontCategoryRequest frontCategoryRequest);
    /**
     *  集合对象克隆
     * @param categoryInfoList
     * @return
     */
    List<FrontCategoryDTO> converterList(List<FrontCategoryDO> categoryInfoList);
}
